package com.winphone.uvam.config;

import com.winphone.uvam.interceptor.AllInterceptor;
import com.winphone.uvam.interceptor.CommonInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @author: zhou
 * @Description:
 * @Date:Create in 2017/12/17
 * @Modified By:
 */
//@ComponentScan
@Configuration
public class WebMvcConfig extends WebMvcConfigurerAdapter {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // TODO Auto-generated method stub
        //增加跨域访问拦截器
        registry.addInterceptor(new CommonInterceptor()).addPathPatterns("/api/**");
        registry.addInterceptor(new AllInterceptor()).addPathPatterns("/**");
    }

}
